<!--
	作者：956911785@qq.com
	时间：2019年9月14日16:53:17
	描述：诗词作业检查人员设置
-->
<template>
    <div style="width:100%;"> 
        <Tetable ref="tdtable" height="450" :columns="columns9" type="post" :paramiters="tj" :serverUrl="serverUrl"></Tetable>
		<edit ref="edit" :editparam="editparam" v-on:reload="load()"></edit>
    </div> 
</template>
<script>
	import EditDelLook from "./EditDelLook";
	import edit from "./editTcontent";
    export default {
    	name: "poetryreadss",
    	props: {
    		tj:{
    			type: Object
    		},	
    	},
        data () {
            return {
            	serverUrl:"/host/readbook/poetryread/search_poetryread.html",
                columns9: [
                    {
                        type: 'index',
                        width: 60,
                        title: '序号',
                        align: 'center'
                    },{
                        title: '诗词名称',
                        key: 'PNAME',
                        align: 'center', 
                    }, {
                        title: '作者',
                        key: 'AUTHOR',
                        align: 'center', 
                    }, {
                        title: '日期',
                        key: 'RIQI',
                        align: 'center', 
                    },  {
                        title: '周',
                        key: 'WEEKDAY',
                        align: 'center', 
                    }, {
                        title: '负责检查的账号',
                        key: 'DLZH',
                        align: 'center', 
                    }, {
                        title: '操作',
                        key: 'action',
                        width: 120,
                        align: 'center',
                        render: (h, params) => {
                            return h(EditDelLook, {
                            	on: {
                                    //删除检查任务
                                    remove: () =>{
                                    	const rows=params.row;
                                        this.removepoetry(rows.READID,rows.RIQI)
                                    },
                                    //修改检查任务设置
                                    edit: () =>{
                                    	const rows=params.row;
                                    	this.editparam=rows;
 										//打开修改
 										this.$refs.edit.modal0=true;
                                    },
                                }
                            });
                        }
                    }
                ],
                editparam:{},
                readid:''
            }
        },
        computed: {
		},
		methods: {
			//删除检查任务
			removepoetry:function(readid,riqi){
                this.$Modal.confirm({
                    title: '警告',
                    content: '请确定是否删除！！！',
                    onOk: () => {
                    	//执行删除代码
                    	this.$http.get("/host/readbook/poetryread/del_poetryreadscore.html?readid="+readid+"&riqi="+riqi)
						.then(datas => {
							if(datas.result){
								//删除成功 刷新页面
								this.$Message.info('删除成功');
								this.$refs.tdtable.load();
							}else{
								//删除成功 刷新页面
								this.$Message.info(datas.msg);
								this.$refs.tdtable.load();
							}
							
						});
                    }
                });
			},
			
			
			load(){
				this.$refs.tdtable.load();
			},

	    },
		mounted() {
		},
		watch:{
		},
		components: {
			EditDelLook,
			edit
		}
    }
</script>


<style scoped="scoped">
	
	.ivu-table-wrapper {
		border:none;
	}
	
	.toolstipdiv{
		width: '100%';
		overflow: 'hidden';
		textOverflow: 'ellipsis';
		whiteSpace: 'normal';
		wordBreak: 'break-all';
		color:'#fff';
		text-align: center;
	}
	.toolstipdiv:hover{
		background:rgb(63, 193, 201);
	}
	
	.ivu-tooltip-rel label:hover{
		color:#0023FB;
	}
	
	.tablediv{
		height: '40px';
		overflow:'hidden';
		line-height: '40px';
	}
</style>



